import json

import requests
import time

stram = int(time.time()*1000)

url = f"https://product.weather.com.cn/alarm/grepalarm_cn.php?_={stram}"

headers = {
'referer':'https://www.weather.com.cn/'
}

response = requests.get(url, headers=headers)

response.raise_for_status()
content = response.content.decode('utf-8')[14:-1]
data = json.loads(content)
time.sleep(1)
for item in data['data']:
    print(item)
    item_url = f"https://product.weather.com.cn/alarm/webdata/{item[1]}?_={stram}"
    item_response = requests.get(item_url,headers=headers)
    content_detail = item_response.content.decode('utf-8')[14:]
    print(content_detail)